home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / fcfgw40s.zip / PROPFILE.CPP < prev    next >
C/C++ Source or Header  |  1996-04-19  |  2KB  |  83 lines

  1. // PropFileLoc.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "FileCFG.h"
  6. #include "PropFileLoc.h"
  7. #include <stdlib.h>
  8. #include <direct.h>
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CPropFileLoc property page
  18.  
  19. IMPLEMENT_DYNCREATE(CPropFileLoc, CPropertyPage)
  20.  
  21. CPropFileLoc::CPropFileLoc() : CPropertyPage(CPropFileLoc::IDD)
  22. {
  23.     //{{AFX_DATA_INIT(CPropFileLoc)
  24.     m_FileListPath = _T("");
  25.     m_FileLocation = _T("");
  26.     m_AreaName = _T("");
  27.     m_DateFormat = 0;
  28.     //}}AFX_DATA_INIT
  29. }
  30.  
  31. CPropFileLoc::~CPropFileLoc()
  32. {
  33. }
  34.  
  35. void CPropFileLoc::DoDataExchange(CDataExchange* pDX)
  36. {
  37.     CPropertyPage::DoDataExchange(pDX);
  38.     //{{AFX_DATA_MAP(CPropFileLoc)
  39.     DDX_Text(pDX, IDC_EDIT_LISTING, m_FileListPath);
  40.     DDV_MaxChars(pDX, m_FileListPath, 79);
  41.     DDX_Text(pDX, IDC_EDIT_LOCATION, m_FileLocation);
  42.     DDV_MaxChars(pDX, m_FileLocation, 79);
  43.     DDX_Text(pDX, IDC_EDIT_NAME, m_AreaName);
  44.     DDV_MaxChars(pDX, m_AreaName, 79);
  45.     DDX_CBIndex(pDX, IDC_COMBO_DATE_STYLE, m_DateFormat);
  46.     //}}AFX_DATA_MAP
  47. }
  48.  
  49.  
  50. BEGIN_MESSAGE_MAP(CPropFileLoc, CPropertyPage)
  51.     //{{AFX_MSG_MAP(CPropFileLoc)
  52.     ON_BN_CLICKED(IDC_BUTTON_LISTING, OnButtonListing)
  53.     //}}AFX_MSG_MAP
  54. END_MESSAGE_MAP()
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CPropFileLoc message handlers
  58.  
  59. void CPropFileLoc::OnButtonListing() 
  60. {
  61.     char        curPath[_MAX_PATH], listPath[_MAX_PATH];
  62.     char        listDrive[_MAX_DRIVE], listDir[_MAX_DIR];
  63.     DWORD       nFlags = OFN_HIDEREADONLY|OFN_NOLONGNAMES|OFN_NOTESTFILECREATE|OFN_EXTENSIONDIFFERENT;
  64.     static char szFilter[] = "RA-compatible lists (*.bbs) | *.bbs | PCBoard lists (*.dir) | *.dir | "
  65.                              "Listing files (*.lst) | *.lst | All files (*.*) | *.* ||";
  66.  
  67.     CFileDialog *dlg = new CFileDialog(TRUE, 0, "Files.*", nFlags, szFilter);
  68.  
  69.     _splitpath(m_FileListPath, listDrive, listDir, 0, 0);
  70.     _makepath(listPath, listDrive, listDir, 0, 0);
  71.     _getcwd(curPath, sizeof(curPath));
  72.     _chdir(listPath);
  73.     if( dlg ){
  74.         if( IDOK == dlg->DoModal() ){
  75.             m_FileListPath = dlg->GetPathName();
  76.             UpdateData(FALSE);    // xfer to screen
  77.         }
  78.         delete dlg;
  79.     }
  80.     _chdir(curPath);
  81. }
  82.  
  83.